package demo3;



interface IShape{

      public abstract void draw();//抽象方法
    default public void func(){
        System.out.println("fafafaf");
    }
//    public static void funcStatic(){
//        System.out.println("fafa");
//    }
}

class Rect implements IShape{
    @Override
    public void draw() {
        System.out.println("♦");
    }

    @Override
    public void func() {
        System.out.println("重写接口当中的默认方法");
    }
}
class Flower implements IShape {
    public void draw(){
        System.out.println("❀");
    }
}

class Triangle implements IShape {
    @Override
    public void draw() {
        System.out.println("△");
    }
}

class Cycle implements IShape {
    @Override
    public void draw() {
        System.out.println("○");
    }
}

public class Test {
    public static void drawMap(IShape iShape){
        iShape.draw();
    }

    public static void main(String[] args) {
        Rect rect = new Rect();
        Flower flower = new Flower();
        drawMap(rect);
        drawMap(flower);
    }
    public static void main1(String[] args) {
//        IShape iShape = new IShape() {
//        }
        IShape iShape = new Rect();
        iShape.draw();
    }
}
